@extends('layouts.app')

@section('title', '首页')

@if(auth::user()->role_id != 22)
    @section('content')
        <div id="tt" class="easyui-tabs" style="width:100%;" data-options="border:false,fit:true,plain:true">
            <div title="首页">
                <div class="row">

                    <div class="col-lg-6 col-md-6 mg_t25">
                        <div class="easyui-panel " title="重点单位" style="width:100%;height:320px;padding:10px;"
                             data-options="iconCls:'icon-save'">


                                    <table id="t1" class="easyui-datagrid" data-options="rownumbers:true,singleSelect:true,url:'{{url('admin/Mainapi/index')}}',method:'get',toolbar:'#tb'" border="false">
                                        <thead frozen="true">
                                            <tr>
                                                <th field="name" width="80%">重点单位</th>
                                                <th field="created_at" width="20%" align="center">添加时间</th>
                                            </tr>
                                        </thead>
                                    </table>

    <!--
                            <ul class="ul-list" id="" data-options="rownumbers:true,singleSelect:true,pagination:true,pageSize:20,url:'{{url('admin/mainapi/index')}}',method:'get',toolbar:'#tb'">


                                <a href="javascript:;" onclick="">
                                <li data-options="field:'name'">
                                    <i class="color1 fa fa-file-text-o"></i>
                                    <span class="times" data-options="field:'created_at'"></span>
                                </li>
                                </a>


                            </ul> -->

                            <script type="text/javascript">
                              function tiao(id){
                                $('#w').window({
                                    title: "编辑",
                                    minimizable:false,
                                    closed: false,
                                    href: 'http://nb.yntosite.com/admin/units/edit/'+id,
                                    modal:true,

                                });
                                }
                            </script>


                        </div>
                    </div>


                    <div class="col-lg-6 col-md-6 mg_t25">
                        <div class="easyui-panel " title="重要部位" style="width:100%;height:320px;padding:10px;"
                             data-options="iconCls:'icon-save'">



                                <table id="t2" class="easyui-datagrid" data-options="rownumbers:true,singleSelect:true,url:'{{url('admin/Mainapi/indextwo')}}',method:'get',toolbar:'#tb'" border="false">
                                    <thead frozen="true">
                                        <tr>
                                            <th field="name" width="80%">重要部位</th>
                                            <th field="gname" width="20%" align="center">所属企业</th>
                                        </tr>
                                    </thead>
                                </table>

                        </div>
                    </div>
                    <div class="col-lg-6 col-md-6 mg_t25">
                        <div class="easyui-panel " title="重点人员" style="width:100%;height:320px;padding:10px;"
                             data-options="iconCls:'icon-save'">


                                <table id="t3" class="easyui-datagrid" data-options="rownumbers:true,singleSelect:true,url:'{{url('admin/Mainapi/indexthree')}}',method:'get',toolbar:'#tb'" border="false">
                                    <thead frozen="true">
                                        <tr>
                                            <th field="name" width="80%">重点人员</th>
                                            <th field="gname" width="20%" align="center">所属企业</th>
                                        </tr>
                                    </thead>
                                </table>

                        </div>
                    </div>
                    <div class="col-lg-6 col-md-6 mg_t25">
                        <div class="easyui-panel " title="治安保卫重点单位统计表" style="width:100%;height:320px;padding:10px;"
                             data-options="iconCls:'icon-save'">
                            <p style="text-align:center;margin-top: 130px;">暂无数据</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="w" class="easyui-window" closed="true" style="width:1400px;height:650px;padding:10px;"></div>

        <script type="text/javascript">

            function load_city_data_from_menu($id){
                $('#t1').datagrid('load',{
                    id: $id,
                });

                 $('#t2').datagrid('load',{
                    id: $id,
                });

                  $('#t3').datagrid('load',{
                    id: $id,
                });



            }

            function load_area_data_from_menu($id){
                $('#t1').datagrid('load',{
                    id: $id,
                });

                 $('#t2').datagrid('load',{
                    id: $id,
                });

                  $('#t3').datagrid('load',{
                    id: $id,
                });




            }
            function load_org_data_from_menu($id){
                $('#t1').datagrid('load',{
                    id: $id,
                });

                 $('#t2').datagrid('load',{
                    id: $id,
                });

                  $('#t3').datagrid('load',{
                    id: $id,
                });


            }


        </script>

    @endsection
    @else

     @section('content')
    
            @if(auth::user()->unit_id != '')

                <div class="row" style="background:url({{ URL::asset('/') }}images/bg_qiye.jpg) no-repeat;width:100%;height:100%;background-size: cover;display:block;position: relative">
                    <div class="main_cmy" style="height: 540px;">
                        <div class="menu_cmy">
                            <div class="list_cmy">
                                <a href="{{url('admin/units/index')}}">
                                    <div class="box_cmy cmy_bgcolor1">
                                        <div class="img_cmy"><img src="{{ URL::asset('/') }}images/jbxx.png"></div>
                                        <p>基本信息</p>
                                    </div>
                                </a>

                            </div>
                            <div class="list_cmy">
                                <a href="{{url('admin/jq/index')}}">
                                    <div class="box_cmy cmy_bgcolor2">
                                        <div class="img_cmy"><img src="{{ URL::asset('/') }}images/jqsb.png"></div>
                                        <p>警情上报</p>
                                    </div>
                                </a>
                            </div>


                             <div class="list_cmy">
                                <a href="{{url('admin/rysh/index')}}">
                                    <div class="box_cmy cmy_bgcolor6">
                                        <div class="img_cmy"><img src="{{ URL::asset('/') }}images/ryhc.png"></div>
                                        <p>人员核查</p>
                                    </div>
                                </a>
                            </div>
                        </div>
                        <div class="menu_cmy mg mg_t50">
                            <div class="list_cmy">
                                <a href="{{url('admin/tz/index')}}">
                                    <div class="box_cmy cmy_bgcolor3">
                                        <div class="img_cmy"><img src="{{ URL::asset('/') }}images/tzgg.png"></div>
                                        <p>通知公告</p>
                                    </div>
                                </a>
                            </div>
                            <div class="list_cmy">
                                <a href="{{url('admin/bg/bgindex')}}">
                                    <div class="box_cmy cmy_bgcolor4">
                                        <div class="img_cmy"><img src="{{ URL::asset('/') }}images/bgt.png"></div>
                                        <p>曝光台</p>
                                    </div>
                                </a>
                            </div>
                            <div class="list_cmy">
                                <a href="{{url('admin/bz/index')}}">
                                    <div class="box_cmy cmy_bgcolor5">
                                        <div class="img_cmy"><img src="{{ URL::asset('/') }}images/fuwu.png"></div>
                                        <p>服务</p>
                                    </div>
                                </a>
                            </div>
                        </div>
                        <div class="menu_cmy mg mg_t50">
                            <div class="list_cmy">
                                <a href="{{url('admin/xs/index')}}">
                                    <div class="box_cmy cmy_bgcolor7">
                                        <div class="img_cmy"><img src="{{ URL::asset('/') }}images/jubao.png"></div>
                                        <p>线索举报</p>
                                    </div>
                                </a>
                            </div>
                            <div class="list_cmy">
                                <a href="{{url('admin/yjfk/index')}}">
                                    <div class="box_cmy cmy_bgcolor8">
                                        <div class="img_cmy"><img src="{{ URL::asset('/') }}images/fankui.png"></div>
                                        <p>建议反馈</p>
                                    </div>
                                </a>
                            </div>
                            <div class="list_cmy">
                                <a href="{{url('admin/qyph/index')}}">
                                    <div class="box_cmy cmy_bgcolor9">
                                        <div class="img_cmy"><img src="{{ URL::asset('/') }}images/paiming.png"></div>
                                        <p>企业排名</p>
                                    </div>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="prompt">
                    <span class="red">温馨提示：系统最佳浏览器为360急速浏览器和谷歌浏览器，最佳分辨率为1920×1080。</span>
                </div>
                <!--<script src="{{ URL::asset('/') }}js/particles.js"></script>
                <script src="{{ URL::asset('/') }}js/background.js"></script>-->
                <script>
                	$(document).ready(function(){
                		$('#box').parent().css('overflow','hidden');
                	})
                </script>

            <script type="text/javascript">
                var source=new EventSource("/admin/push/jq");
                source.onopen = function () {
                    console.log('is open');
                }
                source.onerror = function (event) {
                    console.log(event);
                }
                 source.onmessage=function(event){
                         // 客户端收到消息后，处理
                        // console.log("get message:"+event.data);

                        // datas=event.data.split("|");
                        // console.log(event.data);
                        var data = event.data;
                        console.log(data);
                        if (data > 0) {
                            console.log('ok');
                             // document.getElementById('hip').innerHTML = data;
                        }
                 }



        </script>
        @else

             <div class="row" style="background:url({{ URL::asset('/') }}images/bg_qiye.jpg) no-repeat;width:100%;height:100%;background-size: cover;display:block;position: relative">
                    <div class="main_cmy" style="height: 540px;">
                        <div class="menu_cmy">
                            <div class="list_cmy">
                               
                            </div>
                            <div class="list_cmy">
                                
                            </div>


                             <div class="list_cmy">
                             
                            </div>
                        </div>
                        <div class="menu_cmy mg mg_t50">
                            <div class="list_cmy">
                               
                            </div>
                            <div class="list_cmy">
                                <a href="{{url('admin/units/index')}}">
                                    <div class="box_cmy cmy_bgcolor1">
                                        <div class="img_cmy"><img src="{{ URL::asset('/') }}images/jbxx.png"></div>
                                        <p>添加基本信息</p>
                                    </div>
                                </a>

                            </div>
                            <div class="list_cmy">
                             
                            </div>
                        </div>
                        <div class="menu_cmy mg mg_t50">
                            <div class="list_cmy">
                               
                            </div>
                            <div class="list_cmy">
                                
                            </div>
                            <div class="list_cmy">
                               
                            </div>
                        </div>
                    </div>
                </div>
                <div class="prompt">
                    <span class="red">温馨提示：系统最佳浏览器为360急速浏览器和谷歌浏览器，最佳分辨率为1920×1080。</span>
                </div>
                <!--<script src="{{ URL::asset('/') }}js/particles.js"></script>
                <script src="{{ URL::asset('/') }}js/background.js"></script>-->
                <script>
                    $(document).ready(function(){
                        $('#box').parent().css('overflow','hidden');
                    })
                </script>

            <script type="text/javascript">
                var source=new EventSource("/admin/push/jq");
                source.onopen = function () {
                    console.log('is open');
                }
                source.onerror = function (event) {
                    console.log(event);
                }
                 source.onmessage=function(event){
                         // 客户端收到消息后，处理
                        // console.log("get message:"+event.data);

                        // datas=event.data.split("|");
                        // console.log(event.data);
                        var data = event.data;
                        console.log(data);
                        if (data > 0) {
                            console.log('ok');
                             // document.getElementById('hip').innerHTML = data;
                        }
                 }



            </script>

        @endif



    @endsection
@endif
